cmake_minimum_required(VERSION 3.14.0)
project(demo VERSION 0.1.0)


set(CMAKE_C_COMPILER "c:/Tools/mingw64/bin/gcc.exe")
set(CMAKE_CXX_COMPILER "c:/Tools/mingw64/bin/g++.exe")
message("CMAKE_SOURCE_DIR is " ${CMAKE_SOURCE_DIR})
message("PROJECT_SOURCE_DIR is " ${PROJECT_SOURCE_DIR})
message("CMAKE_CURRENT_SOURCE_DIR is " ${CMAKE_CURRENT_SOURCE_DIR})
message("CMAKE_CURRENT_LIST_DIR is " ${CMAKE_CURRENT_LIST_DIR})
set(PROJECT_ROOT_DIR ${PROJECT_SOURCE_DIR})
message("PROJECT_ROOT_DIR is:" ${PROJECT_ROOT_DIR})

add_subdirectory(src)
add_subdirectory(test/googletest)
set(SRC ${PROJECT_ROOT_DIR}/src)
set(INCLUDE ${PROJECT_ROOT_DIR}/include)
include_directories(${INCLUDE} ${INCLUDE}/common ${INCLUDE}/utils)
message("SRC is:" ${SRC})
message("INCLUDE is:" ${INCLUDE})

include(CTest)
enable_testing()

aux_source_directory(SRC SOURCE)  # 查找在SRC 路径下的所有源文件 将名称保存到 SOURCE 变量

add_executable(demo ${SOURCE})

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include(CPack)
